<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		</meta>
		<title>基于物联网的防火警报系统</title>
		<style>
			.space{
				margin-left: 10px;
				height: 30px;
				line-height: 30px;
				width: 88px;
				font-size: 15px;
				text-align: center;
				color: #FFFFFF;
				background-color: #0c727e;
				border-radius: 4px;
			}
			.space:hover{
				transform: scale(1.03);
				cursor: pointer;
			}
		</style>
		<script type="text/javascript">
		    var xmlhttp;
            if (window.XMLHttpRequest){
                 xmlhttp=new XMLHttpRequest();
			}else{
                 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
            }
			function openAlarm(){
			    console.log('2222');
				xmlhttp.open("GET","/Warn?t=on",true);
				xmlhttp.send();
			}
			function normalAlarm(){
			    console.log('2222');
				xmlhttp.open("GET","/Warn?t=on1",true);
				xmlhttp.send();
			}
			function closeAlarm(){
			    console.log('111111');
				xmlhttp.open("GET","/Warn?t=off",true);
				xmlhttp.send();
			}
        </script>
	</head>
	<body style="background-color: #FFFFFF;">
		<h2 align="center" style="color: #0C727E;font-size: 40px;font-family: " 楷体";">
			基于物联网的防火警报系统&nbsp;&nbsp;
			<span style="font-size: 20px;color: #75DC66;font-family: " 微软雅黑";">(当前状态: %s)</span>
		</h2>
		<h3 align="center" style="color: lightblue;font-size: 25px;font-family: " 微软雅黑";">
			温度:&nbsp;%02d
			<span style="font-size: 25px;color: lightblue;font-family: " 微软雅黑";">&nbsp;&nbsp;&nbsp;湿度:&nbsp;%02d</span>
		</h3>
		<h3 align="center" style="color: lightblue;font-size: 25px;font-family: " 微软雅黑";">
			气体浓度:&nbsp;%02d
		</h3>
		<table align="center">
				<tr>
					<td style="color: #625A33;font-size: 20px;font-family: "黑体";">测试警报控制:</td>
					<td>
						<button type="button" class="space" onclick="openAlarm()">&nbsp;开&nbsp;</button>				
					</td>
					<td>
						<button type="button" class="space" onclick="closeAlarm()">&nbsp;关&nbsp;</button>
					</td>
				</tr>
		</table>
		<table align="center">
				<tr>
					<td style="color: #625A33;font-size: 20px;font-family: "黑体";">启动正常警报:</td>
					<td>
						<button type="button" class="space" onclick="normalAlarm()">&nbsp;开&nbsp;</button>				
					</td>
					<td>
						<button type="button" class="space" onclick="closeAlarm()">&nbsp;关&nbsp;</button>
					</td>
				</tr>
		</table>
	</body>
</html>
